#pragma once
#include "EString.h"
#include "FolderInfo.h"

namespace AID
{
	class VirtualFile;
	class FolderHandlerBase;

	typedef std::list<VirtualFile*>				VirtualFileList;
	typedef VirtualFileList::iterator			VirtualFileI;
	typedef VirtualFileList::const_iterator		VirtualFileCI;

	class VirtualFile
	{
	private:
		//pls don't use new for VirtualFile; use ::addChildren or createRoot.
		VirtualFile(void);
		VirtualFile(const VirtualFile& copy);
		VirtualFile(System::String name, VirtualFile* parent);
	public:
		~VirtualFile(void);
		static VirtualFile* createRoot(void);
		const VirtualFileList&	getChildren(FolderHandlerBase* virtualFolderHandler);
		bool isFolder (void) const;
		VirtualFile*	addChildren(const System::String& name);
		const System::String&	getPath(void) const;
		void setCompleted();
	private:
		void computePath(void);
	private:
		System::String		m_name;
		VirtualFile*		m_parent;
		VirtualFileList		m_children;
		FolderInfo*			m_folderInfo;
		System::String		m_path;
		bool				m_isFolder;
		bool				m_isComplete;
	};	

	inline bool VirtualFile::isFolder (void) const
	{
		return m_isFolder;
	}
}